nxp hashcrypt: preserve AES OFB/CFB streaming state across calls - #11262
Conversation
|
Can one of the admins verify this patch? |
Drive OFB/CFB from the ECB primitive with reg/tmp/left kept in the Aes context, add NULL/zero-length guards, and re-enable the streaming regression checks.
c661d83 to
6cc25e2
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the NXP HASHCRYPT AES port to correctly maintain OFB/CFB streaming state across multiple calls by generating keystream from the ECB primitive and persisting reg/tmp/left in the Aes context. It also re-enables previously-disabled regression checks to verify correct streaming behavior.
Changes:
- Rework NXP HASHCRYPT AES OFB/CFB to be stateful across calls using per-block ECB keystream generation stored in the
Aescontext. - Add
NULLargument guards and explicit zero-length fast-path returns for the new OFB/CFB implementations. - Remove
#ifndef WOLFSSL_NXP_HASHCRYPT_AESskips in AES OFB/CFB streaming regression checks so the tests run for the NXP port again.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| wolfcrypt/src/port/nxp/hashcrypt_port.c | Implements stateful OFB/CFB using ECB keystream blocks and persisted context state (reg/tmp/left) to preserve streaming across calls. |
| wolfcrypt/test/test.c | Re-enables OFB/CFB streaming regression comparisons for WOLFSSL_NXP_HASHCRYPT_AES now that the port preserves state correctly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11262
Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Drive OFB/CFB from the ECB primitive with reg/tmp/left kept in the Aes context, add NULL/zero-length guards, and re-enable the streaming regression checks.